package SourceCode.FunctionInterface.code;

import java.util.Objects;
import java.util.function.BiConsumer;

/**
 * @Description 接受两个参数，无返回值
 * @Author bloodcolding
 * @Date 2021/01/23 5:27 PM
 */
public class ImpBiConsumer<T, U> implements BiConsumer<T, U> {
    /**
     * 接受两个参数，无返回值
     *
     * @param t
     * @param u
     */
    @Override
    public void accept(T t, U u) {

    }

    /**
     * 当前accept()之后执行after的accept()
     *
     * @param after
     * @return
     */
    @Override
    public BiConsumer<T, U> andThen(BiConsumer<? super T, ? super U> after) {
        Objects.requireNonNull(after);

        return (l, r) -> {
            accept(l, r);
            after.accept(l, r);
        };
    }
}
